package com.czwx.bee.business.manager.modular.statistics.service.impl;

import com.czwx.bee.business.manager.modular.statistics.model.BizDataModel;
import com.czwx.bee.business.manager.modular.statistics.service.BusinessDataService;
import org.beetl.sql.core.SQLManager;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @Author:wiki
 * @Date:Create in 2018/7/3 0003 下午 4:56
 */
@Service
public class BusinessDataServiceImpl implements BusinessDataService {
    @Autowired
    private SQLManager sqlManager;

    @Override
    public void getData(PageQuery query) {
        sqlManager.pageQuery("statistics.Statistics.list",BizDataModel.class,query);
    }

    @Override
    public BizDataModel headerTable(Map params) {
        return   sqlManager.selectSingle("statistics.Statistics.headerTable",params,BizDataModel.class);
    }

//    @Transactional
//    @Override
//    public void initDate() {
////        String sql="INSERT INTO bp_date (date) VALUES (2018-07-06 09:36:27)";
//        Date date=DateUtil.parseDate("2018-05-01 00:00:00");
//        List<IntiDate> list=new ArrayList<>();
//        for(int i=0;i<1000;i++) {
//            IntiDate intiDate=new IntiDate();
//            intiDate.setDate(date);
//            list.add(intiDate);
//            date=DateUtil.offsetDay(date,1);
//        }
//        sqlManager.insertBatch(IntiDate.class,list);
//        System.out.print("end！");
//    }


}
